<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>Unicode::Map - metacpan.org</title>
        <link rel="preload" as="fetch" href="https://metacpan.org/account/login_status" crossorigin="anonymous" />
        <link href="https://metacpan.org/_assets/b8ccceeed47a0652049703d99326a9cea4933443.css" rel="stylesheet" type="text/css">
        <script src="https://metacpan.org/_assets/6bfedafe2d7caa915b7d84f61b45936818e3242e.js" type="text/javascript" defer></script>
        <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of Unicode-Map - MetaCPAN" href="https://metacpan.org/dist/Unicode-Map/releases.rss" />
        <link rel="canonical" href="./Unicode::Map.html" />
        <meta name="description" content="An utility to map texts from and to unicode" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
        <link rel="shortcut icon" href="https://metacpan.org/static/icons/favicon.ico">
        <link rel="apple-touch-icon" sizes="152x152" href="https://metacpan.org/static/icons/apple-touch-icon.png">
        <link rel="search" href="https://metacpan.org/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          (function(skey, ga_id){
            ga('create', ga_id, {
              siteSpeedSampleRate : 100,
              storage             : 'none',
              clientId            : localStorage.getItem(skey)
            });
            ga(function(tracker) {
              localStorage.setItem(skey, tracker.get('clientId'));
            });
            ga('send', 'pageview');
          })('ga:clientId', 'UA-27829474-1');
        </script>
<meta name="twitter:card"        content="summary" />
<meta name="twitter:url"         content="https://metacpan.org/pod/Unicode::Map" />
<meta name="twitter:title"       content="Unicode::Map" />
<meta name="twitter:description" content="" />
<meta name="twitter:site"        content="metacpan" />
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="header-logo-large hidden-xs">
              <a href="https://metacpan.org/" tabindex="0">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#logo" />
                </svg>
              </a>
            </div>
            <div class="header-logo-icon visible-xs">
              <a href="https://metacpan.org/">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#dots" />
                </svg>
              </a>
            </div>
            <ul class="nav navbar-nav menu-items hidden-xs hidden-sm">
              <li><a href="https://metacpan.org/about">About</a></li>
              <li><a href="https://metacpan.org/about/sponsors">Sponsor</a></li>
              <li><a href="https://grep.metacpan.org/">grep::cpan</a></li>
              <li><a href="https://metacpan.org/recent">Recent</a></li>
              <li><a href="https://metacpan.org/about/faq">FAQ</a></li>
              <li><a href="https://metacpan.org/tools">Tools</a></li>
              <li><a href="https://fastapi.metacpan.org/">API</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <button type="button" class="searchbar-btn visible-xs visible-sm">
                    <i class="fa fa-search button-fa-icon"></i>
                </button>
                <form action="https://metacpan.org/search" class="searchbar-form visible-md visible-lg search-form form-horizontal">
                   <input type="hidden" name="size" id="metacpan_search-size" value="20">
                  <div class="form-group">
                      <div class="search-group">
                        <i class="fa fa-search"></i>
                        <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value="">
                      </div>
                  </div>
                </form>
                    <li class="icon-slidepanel visible-xs visible-sm">
                      <button data-toggle="slidepanel" data-target=".slidepanel">
                        <span class="button-fa-icon">
                          <i class="fa fa-bars slidepanel-open"></i>
                          <i class="fa fa-times slidepanel-close"></i>
                        </span>
                      </button>
                    </li>
                <form action="https://metacpan.org/account/logout" method="POST" id="metacpan-logout"></form>
                <li class="dropdown logged_in" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="https://metacpan.org/account/identities">Identities</a></li>
                        <li><a href="https://metacpan.org/account/profile">Profile</a></li>
                        <li><a href="https://metacpan.org/account/favorite/list">Favorites</a></li>
                        <li>
                            <a href="./Unicode::Map.html#" type="button" onclick="$('#metacpan-logout').submit(); return false">
                              Logout
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_out" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="https://metacpan.org/login/github">
                                <i class="fab fa-github fa-fw"></i>
                                GitHub
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/twitter">
                                <i class="fab fa-twitter fa-fw"></i>
                                Twitter
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/google">
                                <i class="fab fa-google fa-fw"></i>
                                Google
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_placeholder">
                    <button>
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                    </button>
                </li>
            </ul>
        </nav>
        <div class="page-content ">
          <!--
          <div class="top-notify-banner">
            <i class="fas fa-info-circle"></i>
          </div>
          -->
          <nav class="sidebar">
            <div class="slidepanel">
              <ul class="nav-list ">
    <li class="nav-header no-margin-top">
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of Unicode-Map was released.">
      <span class="relatize">02 Apr 2002 22:09:09 UTC</span>
    </li>
  <li>
    Distribution: <a href="https://metacpan.org/dist/Unicode-Map">Unicode-Map</a>
  </li>
  <li>
    Module version: 0.112
  </li>
  <li>
    <a data-keyboard-shortcut="g s" href="https://metacpan.org/dist/Unicode-Map/source/Map.pm">Source</a>
    (<a href="https://metacpan.org/dist/Unicode-Map/source/Map.pm?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g b" href="https://metacpan.org/dist/Unicode-Map/source">Browse</a>
    (<a href="https://metacpan.org/dist/Unicode-Map/source?raw=1">raw</a>)
  </li>
    <li>
      <a data-keyboard-shortcut="g c" href="https://metacpan.org/dist/Unicode-Map/changes">Changes</a>
    </li>
    <li>
      <a class="nopopup" href="https://metacpan.org/dist/Unicode-Map/contribute">How to Contribute</a>
    </li>
    <li>
      <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://rt.cpan.org/Public/Dist/Display.html?Name=Unicode-Map">Issues</a>
      (2)
    </li>
    <li>
      <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=Unicode-Map+0.112" title="Matrix">Testers</a>
        <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/U/Unicode-Map.html?oncpan=1&amp;distmat=1&amp;version=0.112&amp;grade=2" style="color: #090">30</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/U/Unicode-Map.html?oncpan=1&amp;distmat=1&amp;version=0.112&amp;grade=3" style="color: #900">0</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/U/Unicode-Map.html?oncpan=1&amp;distmat=1&amp;version=0.112&amp;grade=4">0</a>)</span>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/MSCHWARTZ/Unicode-Map-0.112">Kwalitee</a>
    </li>
    <li>
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on Unicode-Map who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)">
      Bus factor: 0
      </div>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpancover.com/latest/Unicode-Map-0.112/index.html">36.93% Coverage </a>
    </li>
    <li>
      License: unknown
    </li>
    <li class="nav-header">Activity</li>
    <li>
<div class="activity-graph">
    <img src="https://metacpan.org/dist/Unicode-Map/activity.svg?res=month" />
    <div class="comment">24 month</div>
</div>
    </li>
    <li class="nav-header">Tools</li>
    <li>
      <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/M/MS/MSCHWARTZ/Unicode-Map-0.112.tar.gz">
      Download (<span itemprop="fileSize">464.96KB</span>)</a>
    </li>
    <li>
      <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FMSCHWARTZ%2FUnicode-Map-0.112%2FMap.pm">
        MetaCPAN Explorer
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Unicode-Map/permissions">
        Permissions
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Unicode-Map/releases.rss">
        Subscribe to distribution
      </a>
    </li>
    <li>
      <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog">
        Install Instructions
      </button>
    </li>
    <li>
      <form action="https://metacpan.org/search">
        <input type="hidden" name="q" value="dist:Unicode-Map">
        <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
      </form>
    </li>
    <li>
      <form action="https://grep.metacpan.org/search">
        <input type="hidden" name="qd" value="Unicode-Map">
        <input type="hidden" name="source" value="metacpan">
        <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
     </form>
    </li>
    <li class="version-jump">
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/Map.pm&#39;" class="form-control tool-bar-form">
  <option disabled selected>Jump to version</option>
<option
  disabled
  value="MSCHWARTZ/Unicode-Map-0.112"
>0.112
  (MSCHWARTZ on 2002-04-02)</option>
<option
  
  value="MSCHWARTZ/Unicode-Map-0.110"
>0.110
  (MSCHWARTZ on 2000-08-21)</option>
<optgroup label="BackPAN">'
<option
  
  value="MSCHWARTZ/Unicode-Map-0.109"
>0.109
  (MSCHWARTZ on 2000-06-29)</option>
<option
  
  value="MSCHWARTZ/Unicode-Map-0.108"
>0.108
  (MSCHWARTZ on 2000-06-26)</option>
<option
  
  value="MSCHWARTZ/Unicode-Map-0.105"
>0.105
  (MSCHWARTZ on 1998-02-18)</option>
<option
  
  value="MSCHWARTZ/Unicode-Map-0.104"
>0.104
  (MSCHWARTZ on 1998-02-12)</option>
</optgroup>
</select>
    </li>
    <li class="version-diff">
<select onchange="document.location.href='/release/MSCHWARTZ/Unicode-Map-0.112/diff/' + encodeURIComponent(this.value) + '/Map.pm'
" class="form-control tool-bar-form">
  <option disabled selected>Diff with version</option>
<option
  disabled
  value="MSCHWARTZ/Unicode-Map-0.112"
>0.112
  (MSCHWARTZ on 2002-04-02)</option>
<option
  
  value="MSCHWARTZ/Unicode-Map-0.110"
>0.110
  (MSCHWARTZ on 2000-08-21)</option>
<optgroup label="BackPAN">'
<option
  
  value="MSCHWARTZ/Unicode-Map-0.109"
>0.109
  (MSCHWARTZ on 2000-06-29)</option>
<option
  
  value="MSCHWARTZ/Unicode-Map-0.108"
>0.108
  (MSCHWARTZ on 2000-06-26)</option>
<option
  
  value="MSCHWARTZ/Unicode-Map-0.105"
>0.105
  (MSCHWARTZ on 1998-02-18)</option>
<option
  
  value="MSCHWARTZ/Unicode-Map-0.104"
>0.104
  (MSCHWARTZ on 1998-02-12)</option>
</optgroup>
</select>
    </li>

    <li>
<ul class="dependencies">
  <li class="nav-header">Dependencies</li>
  <li><i class="ttip" title="dynamic_config enabled">unknown</i></li>
  <li>
    <hr>
  </li>
  <li>
    <a href="https://metacpan.org/module/Unicode::Map/requires">Reverse dependencies</a>
  </li>
  <li>
    <a href="http://deps.cpantesters.org/?module=Unicode%3A%3AMap">CPAN Testers List</a>
  </li>
  <li>
    <a href="https://cpandeps.grinnz.com/?dist=Unicode-Map">Dependency graph</a>
  </li>
</ul>
    </li>
    <li class="nav-header">Permalinks</li>
    <li>
      <a href="https://metacpan.org/release/MSCHWARTZ/Unicode-Map-0.112/view/Map.pm">This version</a>
    </li>
    <li>
      <a href="./Unicode::Map.html">Latest version</a>
    </li>
    <li>
<div class="plussers">
<div class="nav-header">++ed by:</div>
<div>
    1 non-PAUSE user
</div>
</div>
    </li>
    <li>
    </li>
              </ul>
            </div>
          </nav>
          <div class="content-navigation">
<div class="breadcrumbs">
  <span>
    <a data-keyboard-shortcut="g a" rel="author" href="https://metacpan.org/author/MSCHWARTZ" class="author-name">Martin Schwartz</a>
  </span>
  <span>&nbsp;/&nbsp;</span>
  <div class="release dist-release status-latest maturity-released">
    <span class="dropdown"><b class="caret"></b></span>
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/Map.pm&#39;" class="">
<option
  selected
  value="MSCHWARTZ/Unicode-Map-0.112"
>0.112
  (MSCHWARTZ on 2002-04-02)</option>
<option
  
  value="MSCHWARTZ/Unicode-Map-0.110"
>0.110
  (MSCHWARTZ on 2000-08-21)</option>
<optgroup label="BackPAN">'
<option
  
  value="MSCHWARTZ/Unicode-Map-0.109"
>0.109
  (MSCHWARTZ on 2000-06-29)</option>
<option
  
  value="MSCHWARTZ/Unicode-Map-0.108"
>0.108
  (MSCHWARTZ on 2000-06-26)</option>
<option
  
  value="MSCHWARTZ/Unicode-Map-0.105"
>0.105
  (MSCHWARTZ on 1998-02-18)</option>
<option
  
  value="MSCHWARTZ/Unicode-Map-0.104"
>0.104
  (MSCHWARTZ on 1998-02-12)</option>
</optgroup>
</select>
    <a data-keyboard-shortcut="g d" class="release-name" href="https://metacpan.org/dist/Unicode-Map">Unicode-Map-0.112</a>
  </div>
<span class="river-gauge-gauge">
  <svg width="24px"
       height="15px"
       version="1.1"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">

    <g>
      <title>        River stage two &#10;
          • 2 direct dependents &#10;          • 14 total dependents
      </title>

      <rect x="0"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="5"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="10"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="15"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="20"  y="0" width="4" height="15" fill="#e4e2e2" />
    </g>
  </svg>

</span>
<div id="Unicode-Map-fav" class="logged_in">
<form action="https://metacpan.org/account/favorite/add" style="display: inline" onsubmit="return favDistribution(this)">
    <input type="hidden" name="remove" value="0">
    <input type="hidden" name="release" value="Unicode-Map-0.112">
    <input type="hidden" name="author" value="MSCHWARTZ">
    <input type="hidden" name="distribution" value="Unicode-Map">
    <button type="submit" class="favorite highlight"><span>1</span> ++</button>
</form>
</div>
<div class="logged_out">
<a href="./Unicode::Map.html" onclick="alert('Please sign in to add favorites'); return false" class="favorite highlight">
<span>1</span> ++</a>
</div>
   / <span>Unicode::Map</span>
</div>
          </div>
          <main class="content">


<nav class="toc">
  <div class="toc-header"><strong>Contents</strong></div>
<ul>
  <li><a href="./Unicode::Map.html#NAME">NAME</a></li>
  <li><a href="./Unicode::Map.html#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="./Unicode::Map.html#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="./Unicode::Map.html#CONVERSION-METHODS">CONVERSION METHODS</a></li>
  <li><a href="./Unicode::Map.html#WARNINGS">WARNINGS</a></li>
  <li><a href="./Unicode::Map.html#MAINTAINANCE-METHODS">MAINTAINANCE METHODS</a></li>
  <li><a href="./Unicode::Map.html#DEPRECATED-METHODS">DEPRECATED METHODS</a></li>
  <li><a href="./Unicode::Map.html#BINARY-MAPPINGS">BINARY MAPPINGS</a></li>
  <li><a href="./Unicode::Map.html#TO-BE-DONE">TO BE DONE</a></li>
  <li><a href="./Unicode::Map.html#SEE-ALSO">SEE ALSO</a></li>
  <li><a href="./Unicode::Map.html#AUTHOR">AUTHOR</a></li>
</ul></nav>
<div class="pod anchors">
<h1 id="NAME">NAME</h1>

<p>Unicode::Map V0.112 - maps charsets from and to utf16 unicode</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<ul>

<p>use Unicode::Map();</p>

<p><i>$Map</i> = new Unicode::Map(&quot;ISO-8859-1&quot;);</p>

<p><i>$utf16</i> = <i>$Map</i> -&gt; to_unicode (&quot;Hello world!&quot;); =&gt; $utf16 == &quot;\0H\0e\0l\0l\0o\0 \0w\0o\0r\0l\0d\0!&quot;</p>

<p><i>$locale</i> = <i>$Map</i> -&gt; from_unicode (<i>$utf16</i>); =&gt; $locale == &quot;Hello world!&quot;</p>

</ul>

<p>A more detailed description below.</p>

<p>2do: short note about perl&#39;s Unicode perspectives.</p>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>This module converts strings from and to 2-byte Unicode UCS2 format. All mappings happen via 2 byte UTF16 encodings, not via 1 byte UTF8 encoding. To transform these use Unicode::String.</p>

<p>For historical reasons this module coexists with Unicode::Map8. Please use Unicode::Map8 unless you need to care for two byte character sets, e.g. chinese GB2312. Anyway, if you stick to the basic functionality (see documentation) you can use both modules equivalently.</p>

<p>Practically this module will disappear from earth sooner or later as Unicode mapping support needs somehow to get into perl&#39;s core. If you like to work on this field please don&#39;t hesitate contacting Gisle Aas!</p>

<p>This module can&#39;t deal directly with utf8. Use Unicode::String to convert utf8 to utf16 and vice versa.</p>

<p>Character mapping is according to the data of binary mapfiles in Unicode::Map hierarchy. Binary mapfiles can also be created with this module, enabling you to install own specific character sets. Refer to mkmapfile or file REGISTRY in the Unicode::Map hierarchy.</p>

<h1 id="CONVERSION-METHODS"><a id="CONVERSION"></a>CONVERSION METHODS</h1>

<p>Probably these are the only methods you will need from this module. Their usage is compatible with Unicode::Map8.</p>

<dl>

<dt id="new">new</dt>
<dd>

<p><i>$Map</i> = new Unicode::Map(&quot;GB2312-80&quot;)</p>

<p>Returns a new Map object for GB2312-80 encoding.</p>

</dd>
<dt id="from_unicode">from_unicode</dt>
<dd>

<p><i>$dest</i> = <i>$Map</i> -&gt; from_unicode (<i>$src</i>)</p>

<p>Creates a string in locale charset representation from utf16 encoded string <i>$src</i>.</p>

</dd>
<dt id="to_unicode">to_unicode</dt>
<dd>

<p><i>$dest</i> = <i>$Map</i> -&gt; to_unicode (<i>$src</i>)</p>

<p>Creates a string in utf16 representation from <i>$src</i>.</p>

</dd>
<dt id="to8">to8</dt>
<dd>

<p>Alias for <i>from_unicode</i>. For compatibility with Unicode::Map8</p>

</dd>
<dt id="to16">to16</dt>
<dd>

<p>Alias for <i>to_unicode</i>. For compatibility with Unicode::Map8</p>

</dd>
</dl>

<h1 id="WARNINGS">WARNINGS</h1>

<ul>

<p>You can demand Unicode::Map to issue warnings at deprecated or incompatible usage with the constants WARN_DEFAULT, WARN_DEPRECATION or WARN_COMPATIBILITY. The latter both can be ored together.</p>

<p>No special warnings:</p>

<p>$Unicode::Map::WARNINGS = Unicode::Map::WARN_DEFAULT</p>

<p>Warnings for deprecated usage:</p>

<p>$Unicode::Map::WARNINGS = Unicode::Map::WARN_DEPRECATION</p>

<p>Warnings for incompatible usage:</p>

<p>$Unicode::Map::WARNINGS = Unicode::Map::WARN_COMPATIBILITY</p>

</ul>

<h1 id="MAINTAINANCE-METHODS"><a id="MAINTAINANCE"></a>MAINTAINANCE METHODS</h1>

<p><i>Note:</i> These methods are solely for the maintainance of Unicode::Map. Using any of these methods will lead to programs incompatible with Unicode::Map8.</p>

<dl>

<dt id="alias">alias</dt>
<dd>

<p><i>@list</i> = <i>$Map</i> -&gt; alias (<i>$csid</i>)</p>

<p>Returns a list of alias names of character set <i>$csid</i>.</p>

</dd>
<dt id="mapping">mapping</dt>
<dd>

<p><i>$path</i> = <i>$Map</i> -&gt; mapping (<i>$csid</i>)</p>

<p>Returns the absolute path of binary character mapping for character set <i>$csid</i> according to REGISTRY file of Unicode::Map.</p>

</dd>
<dt id="id">id</dt>
<dd>

<p><i>$real_id</i>||<code>&quot;&quot;</code> = <i>$Map</i> -&gt; id (<i>$test_id</i>)</p>

<p>Returns a valid character set identifier <i>$real_id</i>, if <i>$test_id</i> is a valid character set name or alias name according to REGISTRY file of Unicode::Map.</p>

</dd>
<dt id="ids">ids</dt>
<dd>

<p><i>@ids</i> = <i>$Map</i> -&gt; ids()</p>

<p>Returns a list of all character set names defined in REGISTRY file.</p>

</dd>
<dt id="read_text_mapping">read_text_mapping</dt>
<dd>

<p><code>1</code>||<code>0</code> = <i>$Map</i> -&gt; read_text_mapping (<i>$csid</i>, <i>$path</i>, <i>$style</i>)</p>

<p>Read a text mapping of style <i>$style</i> named <i>$csid</i> from filename <i>$path</i>. The mapping then can be saved to a file with method: write_binary_mapping. &lt;$style&gt; can be:</p>

<pre><code> style          description

 &quot;unicode&quot;    A text mapping as of ftp://ftp.unicode.org/MAPPINGS/
 &quot;&quot;           Same as &quot;unicode&quot;
 &quot;reverse&quot;    Similar to unicode, but both columns are switched
 &quot;keld&quot;       A text mapping as of ftp://dkuug.dk/i18n/charmaps/</code></pre>

</dd>
<dt id="src">src</dt>
<dd>

<p><i>$path</i> = <i>$Map</i> -&gt; src (<i>$csid</i>)</p>

<p>Returns the path of textual character mapping for character set <i>$csid</i> according to REGISTRY file of Unicode::Map.</p>

</dd>
<dt id="style">style</dt>
<dd>

<p><i>$path</i> = <i>$Map</i> -&gt; style (<i>$csid</i>)</p>

<p>Returns the style of textual character mapping for character set <i>$csid</i> according to REGISTRY file of Unicode::Map.</p>

</dd>
<dt id="write_binary_mapping">write_binary_mapping</dt>
<dd>

<p><code>1</code>||<code>0</code> = <i>$Map</i> -&gt; write_binary_mapping (<i>$csid</i>, <i>$path</i>)</p>

<p>Stores a mapping that has been loaded via method read_text_mapping in file <i>$path</i>.</p>

</dd>
</dl>

<h1 id="DEPRECATED-METHODS"><a id="DEPRECATED"></a>DEPRECATED METHODS</h1>

<p>Some functionality is no longer promoted.</p>

<dl>

<dt id="noise">noise</dt>
<dd>

<p>Deprecated! Don&#39;t use any longer.</p>

</dd>
<dt id="reverse_unicode">reverse_unicode</dt>
<dd>

<p>Deprecated! Use Unicode::String::byteswap instead.</p>

</dd>
</dl>

<h1 id="BINARY-MAPPINGS"><a id="BINARY"></a>BINARY MAPPINGS</h1>

<p>Structure of binary Mapfiles</p>

<p>Unicode character mapping tables have sequences of sequential key and sequential value codes. This property is used to crunch the maps easily. n (0&lt;n&lt;256) sequential characters are represented as a bytecount n and the first character code key_start. For these subsequences the according value sequences are crunched together, also. The value 0 is used to start an extended information block (that is just partially implemented, though).</p>

<p>One could think of two ways to make a binary mapfile. First method would be first to write a list of all key codes, and then to write a list of all value codes. Second method, used here, appends to all partial key code lists the according crunched value code lists. This makes value codes a little bit closer to key codes.</p>

<p><b>Note: the file format is still in a very liquid state. Neither rely on that it will stay as this, nor that the description is bugless, nor that all features are implemented.</b></p>

<p>STRUCTURE:</p>

<dl>

<dt id="&lt;main&gt;:"><a id="main"></a>&lt;main&gt;:</dt>
<dd>

<pre><code>   offset  structure     value

   0x00    word          0x27b8   (magic)
   0x02    @(&lt;extended&gt; || &lt;submapping&gt;)</code></pre>

<p>The mapfile ends with extended mode &lt;end&gt; in main stream.</p>

</dd>
<dt id="&lt;submapping&gt;:"><a id="submapping"></a>&lt;submapping&gt;:</dt>
<dd>

<pre><code>   0x00    byte != 0     charsize1 (bits)
   0x01    byte          n1 number of chars for one entry
   0x02    byte          charsize2 (bits)
   0x03    byte          n2 number of chars for one entry
   0x04    @(&lt;extended&gt; || &lt;key_seq&gt; || &lt;key_val_seq)

   bs1=int((charsize1+7)/8), bs2=int((charsize2+7)/8)</code></pre>

<p>One submapping ends when &lt;mapend&gt; entry occurs.</p>

</dd>
<dt id="&lt;key_val_seq&gt;:"><a id="key_val_seq"></a>&lt;key_val_seq&gt;:</dt>
<dd>

<pre><code>   0x00    size=0|1|2|4  n, number of sequential characters 
   size    bs1           key1
   +bs1    bs2           value1
   +bs2    bs1           key2
   +bs1    bs2           value2
   ...</code></pre>

<p>key_val_seq ends, if either file ends (n = infinite mode) or n pairs are read.</p>

</dd>
<dt id="&lt;key_seq&gt;:"><a id="key_seq"></a>&lt;key_seq&gt;:</dt>
<dd>

<pre><code>   0x00    byte          n, number of sequential characters 
   0x01    bs1           key_start, first character of sequence
   1+bs1   @(&lt;extended&gt; || &lt;val_seq&gt;)</code></pre>

<p>A key sequence starts with a byte count telling how long the sequence is. It is followed by the key start code. After this comes a list of value sequences. The list of value sequences ends, if sum(m) equals n.</p>

</dd>
<dt id="&lt;val_seq&gt;:"><a id="val_seq"></a>&lt;val_seq&gt;:</dt>
<dd>

<pre><code>   0x00    byte          m, number of sequential characters
   0x01    bs2           val_start, first character of sequence</code></pre>

</dd>
<dt id="&lt;extended&gt;:"><a id="extended"></a>&lt;extended&gt;:</dt>
<dd>

<pre><code>   0x00    byte          0
   0x01    byte          ftype
   0x02    byte          fsize, size of following structure
   0x03    fsize bytes   something</code></pre>

<p>For future extensions or private use one can insert here 1..255 byte long streams. ftype can have values 30..255, values 0..29 are reserved. Modi are not fully defined now and could change. They will be explained later.</p>

</dd>
</dl>

<h1 id="TO-BE-DONE"><a id="TO"></a>TO BE DONE</h1>

<dl>

<dt id="-"><a id="pod"></a>-</dt>
<dd>

<p>Something clever, when a character has no translation.</p>

</dd>
<dt id="-1"><a id="pod1"></a>-</dt>
<dd>

<p>Direct charset -&gt; charset mapping.</p>

</dd>
<dt id="-2"><a id="pod2"></a>-</dt>
<dd>

<p>Better performance.</p>

</dd>
<dt id="-3"><a id="pod3"></a>-</dt>
<dd>

<p>Support for mappings according to RFC 1345.</p>

</dd>
</dl>

<h1 id="SEE-ALSO"><a id="SEE"></a>SEE ALSO</h1>

<dl>

<dt id="-4"><a id="pod4"></a>-</dt>
<dd>

<p>File <code>REGISTRY</code> and binary mappings in directory <code>Unicode/Map</code> of your perl library path</p>

</dd>
<dt id="-5"><a id="pod5"></a>-</dt>
<dd>

<p>recode(1), map(1), mkmapfile(1), Unicode::Map(3), Unicode::Map8(3), Unicode::String(3), Unicode::CharName(3), mirrorMappings(1)</p>

</dd>
<dt id="-6"><a id="pod6"></a>-</dt>
<dd>

<p>RFC 1345</p>

</dd>
<dt id="-7"><a id="pod7"></a>-</dt>
<dd>

<p>Mappings at Unicode consortium ftp://ftp.unicode.org/MAPPINGS/</p>

</dd>
<dt id="-8"><a id="pod8"></a>-</dt>
<dd>

<p>Registrated Internet character sets ftp://dkuug.dk/i18n/charmaps/</p>

</dd>
<dt id="-9"><a id="pod9"></a>-</dt>
<dd>

<p>2do: more references</p>

</dd>
</dl>

<h1 id="AUTHOR">AUTHOR</h1>

<p>Martin Schwartz &lt;<i>martin@nacho.de</i>&gt;</p>

<div class="pod-errors"><p>1 POD Error</p><div class="pod-errors-detail"><p>The following errors were encountered while parsing the POD:</p><dl><dt>Around line 1112:</dt><dd><p>You can&#39;t have =items (as at line 1118) unless the first thing after the =over is an =item</p></dd></dl></div></div></div>

<div id="metacpan_install-instructions-dialog" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Module Install Instructions</h4>
      </div>
      <div class="modal-body">
        <p>To install Unicode::Map, copy and paste the appropriate command in to your terminal.</p>
        <p><a href="https://metacpan.org/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p>
        <pre><code>cpanm Unicode::Map</code></pre>
        <p><a href="https://metacpan.org/pod/CPAN">CPAN shell</a></p>
        <pre><code>perl -MCPAN -e shell
install Unicode::Map</code></pre>
        <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p>
      </div>
      <div class="modal-footer">
        <a href="./Unicode::Map.html#" data-dismiss="modal" class="btn">Close</a>
      </div>
    </div>
  </div>
</div>
          </main>
          <div class="content-pagination">
          </div>
        </div>
        <footer class="footer">
          <div class="footer-container">
            <div class="footer-social">
              <div class="footer-link footer-logo">
                <a href="https://metacpan.org/">
                  <img src="https://metacpan.org/static/images/metacpan-logo.svg" alt="MetaCPAN" />
                </a>
              </div>
              <a class="footer-social-link" href="https://github.com/metacpan">
                <i class="fab fa-github-square"></i>
              </a>
              <a class="footer-social-link" href="https://fosstodon.org/@metacpan">
                <i class="fab fa-mastodon"></i>
              </a>
            </div>
            <div class="footer-links">
              <div class="footer-link">
                  <a href="https://metacpan.org/about">About</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/sponsors">Sponsor</a>
              </div>
              <div class="footer-link">
                  <a href="https://grep.metacpan.org">grep::cpan</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/recent">Recent</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/faq">FAQ</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/tools">Tools</a>
              </div>
              <div class="footer-link">
                  <a href="https://fastapi.metacpan.org/">API</a>
              </div>
              <div class="footer-link">
                  <a href="https://www.perl.org/">Perl.org</a>
              </div>
            </div>
            <div class="footer-sponsors">
              <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener">
                <img class="footer-sponsor-bytemark" src="https://metacpan.org/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener">
                <img class="footer-sponsor-liquidweb" src="https://metacpan.org/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener">
                <img class="footer-sponsor-deriv" src="https://metacpan.org/static/images/sponsors/deriv.svg" alt="Deriv logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener">
                <img class="footer-sponsor-geocode" src="https://metacpan.org/static/images/sponsors/geocodelogo.svg" alt="Geocode logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener">
                <img class="footer-sponsor-fastly" src="https://metacpan.org/static/images/sponsors/fastly_logo.svg" alt="Fastly logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener">
                <img class="footer-sponsor-opencage" src="https://metacpan.org/static/images/sponsors/open-cage.svg" alt="OpenCage logo">
              </a>
            </div>
          </div>
        </footer>
        <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Keyboard Shortcuts</h4>
              </div>
              <div class="modal-body row">
<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Global</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>s</kbd>
        </td>
        <td>Focus search bar</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>?</kbd>
        </td>
        <td>Bring up this help dialog</td>
      </tr>
    </tbody>
  </table>

  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>GitHub</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>p</kbd>
        </td>
        <td>Go to pull requests</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>go to github issues (only if github is preferred repository)</td>
      </tr>
    </tbody>
  </table>
</div>

<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>POD</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>a</kbd>
        </td>
        <td>Go to author</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>c</kbd>
        </td>
        <td>Go to changes</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>Go to issues</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>d</kbd>
        </td>
        <td>Go to dist</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>r</kbd>
        </td>
        <td>Go to repository/SCM</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>s</kbd>
        </td>
        <td>Go to source</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>b</kbd>
        </td>
        <td>Go to file browse</td>
      </tr>

    </tbody>
  </table>
</div>

<div class="col-md-12">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Search terms</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><em>module:</em> (e.g. <a href="https://metacpan.org/search?q=module%3APlugin">module:Plugin</a>)</td>
      </tr>
      <tr>
        <td><em>distribution:</em> (e.g. <a href="https://metacpan.org/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td>
      </tr>
      <tr>
        <td><em>author:</em> (e.g. <a href="https://metacpan.org/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td>
      </tr>
      <tr>
        <td><em>version:</em> (e.g. <a href="https://metacpan.org/search?q=version%3A1.00">version:1.00</a>)</td>
      </tr>
    </tbody>
  </table>
</div>
              </div>
              <div class="modal-footer"></div>
            </div>
          </div>
        </div>
    </body>
</html>
